1. Field of the Invention
The present invention relates to a coding method for coding an image taken by a plenoptic camera, an electronic camera, a recording medium storing a coded program, and a decoding method of decoding a coded image.
2. Description of the Related Art
FIG. 20 shows a focusing function of an ordinary camera. Light is condensed through a focusing lens 21 and other not-shown optical systems (e.g., a zoom optical system), and projected on an image pickup element 27 arranged at an image plane 21F. The position of the focusing lens 21 with respect to the image plane 21F is changeable along the optical axis 21H, as indicated by the arrow 21B. The position of the focusing lens 21 is used for processing the firmware of a camera upon control of auto-focus (AF), for example. The position of the focusing lens 21 is managed by discrete numeric values. The reference numeral 21A in the drawing indicates such a “focus value”.
When the optical system of an ordinary camera is complicated, or includes a zoom mechanism, the focusing lens 21 is composed of a lens group including two or more lenses. The focus value 21A of such camera indicates the changeable and controllable total conditions of such a lens group.
Basically, a lens of a camera forms, on a plane, an image of an object that exists on another plane. Here, a plane whose image is formed on the image plane 21F without a blur via the focusing lens 21 arranged at a predetermined focus value is called “a best object plane”. When a subject is placed on a best object plane 21D, the image of the subject is formed on the image pickup element 27 in a completely focused state. By changing the focus value 21A, the subject distance 21E, which is a distance from the image plane 21F to the best object plane 21D, can be changed. The focus value 21A and subject distance 21E correspond one-to-one each other.
Actually, there is a depth of field 21G corresponding to an allowable blur range, and even if an object plane 21J is displaced from the best object plane 21D by the length of the depth of field 21G, an image is projected on the image pickup element 27 in a substantially focused state.
FIG. 19A shows the case of photographing with such an ordinary camera. First, the focus on a subject X is adjusted by the operation of auto focus or manual focus. This operation corresponds to adjustment of the best object plane 21D to the subject plane of a subject X by moving the focusing lens 21 in the direction of the optical axis 21H. FIG. 19A shows the state that the focusing lens 21 is moved to a certain focus value 21A, and the best object plane 21D coincides with the subject plane of the subject X. When a release button is pressed in this state, light from the subject X is projected on the image pickup element 27 through the focusing lens 21 in focus.
Contrarily, in a plenoptic camera, light from the subject X is projected on a micro lens array 25, as shown in FIG. 19B. Namely, the micro lens array 25 is provided on the image plane 21F in FIG. 19B, and the image pickup element 27 is arranged on a plane behind the image plane 21F. In this structure, various rays of light K1, K2 and K3 from the subject X projected on the micro lens array 25 are separated by each micro lens 25A, and projected on a part 27A of the image pickup element 27. Therefore, the information formed by the part 27A of the image pickup element includes the information about the directions of the rays of light. The light from the subject X is projected on the micro lens array 25. Therefore, the result of image formation by the image pickup element 27 may include position information indicating the position of a subject from which a ray of light is radiated.
As described above, image information (light field image) as a result of the image formation by an image pickup element of a plenoptic camera includes information about rays of light in a space (light ray information). Therefore, a plenoptic camera can perform sampling of four-dimensional light ray information.
U.S. Pat. No. 6,097,394 describes a method of coding light ray information (light field image information). The method adopts vector quantization to increase a decoding speed. In this method, vector quantized data is decoded by referring to an index in a codebook and outputting it, unlike the predictive coding adopted in a Moving Picture Experts Group (MPEG) system.
In the method of U.S. Pat. No. 6,097,394, light ray information is vector quantized, and the codebook and index used for vector quantization are LZ (Lempel-Ziv) coded, and incorporated into a bit stream. To improve the image quality, for example, coding by trial-and-error is performed until an appropriate codebook is generated for the first time, and a set of training is generated.